package spring.my.db.sharding.demo.response;

/**
 * spring 中有个 HttpStatus 的枚举 可参数
 */
public enum ResponseCode {
    SUCCESS(20000, "ok"),
    NOT_MODIFIED(30400, "not modified"),
    CLIENT_ERROR(40000, "client error"),
    PARAMS_ERROR(40001, "request params error"),
    UNAUTHORIZED(40100, "userId is not null!"),
    RESOURCE_NOT_FOUND(40400, "resource not found"),
    METHOD_NOT_ALLOWED(40500, "method not allowed"),
    SERVER_ERROR(50000, "internal server error"),
    APPLICATION_NOT_FOUND(40600, "channel is not null!"),
    MSG_OS_ERROR(40601, "os is not null!"),
    ;

    private int code;
    private String message;

    ResponseCode(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
